package sg.edu.nus.iss.vmcs.util;

import sg.edu.nus.iss.vmcs.entity.Coin;
import sg.edu.nus.iss.vmcs.ui.CustomerPanel;

public class AccurateCoinValidatorAdapter extends CoinValidator {
	private Coin coin;
	private AccurateCoinValidator accurateCoinValidator;
	
	public AccurateCoinValidatorAdapter(Coin coin) {
		super(coin);
		this.coin = coin;
		this.accurateCoinValidator = new AccurateCoinValidator();
	}

	public boolean validateCoin() {
		Coin actualCoin = CustomerPanel.getCoins().get(coin.getId());
		int result = accurateCoinValidator.acuratlyValidate(actualCoin.asArray(), coin.asArray());
		return result == 1 ? true : false;
	}
	
}
